<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let date = new Date();
    console.log(Date);
    console.log(date);

    // 获取一个月里面多少号
    console.log(date.getDate());

    // 获取年份
    console.log(date.getFullYear());

    // 获取星期几
    console.log(date.getDay());

    // 获取小时
    console.log(date.getHours());

    //获取月份
    console.log(date.getMonth());

    // 获取分钟
    console.log(date.getMinutes());

    // 获取秒钟
    console.log(date.getSeconds());

    // 获取时间戳 以毫秒位单位
    console.log(date.getTime());

    document.write(`${date.getFullYear()}年${date.getMonth()}月${date.getDate()}日`)
  </script>
</body>

</html>